<?php

/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
namespace Admin\Controller;
use Think\Controller;
class SysController extends CommonController {
    function index(){
    if(empty($_POST)){
        $s = new \Admin\Model\SysinfoModel(sys_info);
		$info = $s->getSysinfo();
		$this -> assign('sys',$info);
        $this -> display();
    }else{
         $s = new \Admin\Model\SysinfoModel(sys_info);
		$info = $s->addSysinfo($_POST);
                if($info>0){
                    $this->success('设置成功');
                }else{
                    $this->error('添加失败');
                }
    }    
}
function set(){
	$this->display();
	}
}

